import {State} from "@/store";

export const menuStore: object = {
    state: {
        menulist: [],
        iconObj: {
            125: 'iconfont icon-location',
            103: 'iconfont icon-menu',
            101: 'iconfont icon-text',
            102: 'iconfont icon-yonghu',
            145: 'iconfont icon-setting'
        },
        isCollapse: false,
        activePath: '',
    },
    getters: {
        getMenuList: (state: State) => {
            return state.menulist
        },
        getIconObj: (state: State) => {
            return state.iconObj
        },
        getCollapse: (state: State) => {
            return state.isCollapse
        },
        getActivaPath: (state: State) => {
            return state.activePath
        },
    },
    mutations: {
        setMenuList: (state: State, payload: Array<object>) => {
            // console.log(payload)
            state.menulist = payload
        },
        setCollapse: (state: State, payload: boolean) => {
            state.isCollapse = payload
        },
        setActivePath: (state: State, payload: string) => {
            state.activePath = payload
        },
    }
}